import request from '@/utils/request'
// 获取目录信息列表
export function getCataInfo(params) {
  return request({
    url: '/subject/directory',
    method: 'GET',
    params
  })
}
// 切换开关状态
export function switchState(data) {
  return request({
    url: `/subject/directory/${data.id}`,
    method: 'PUT',
    data
  })
}
// 添加目录
export function addCataInfo(data) {
  return request({
    url: '/subject/directory',
    method: 'POST',
    data
  })
}
// 归属学科下拉框渲染
export function getCataTree() {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}
// 删除目录
export function delCataInfo(id) {
  return request({
    url: `/subject/directory/${id}`,
    method: 'DELETE'
  })
}
// 获取单个目录的信息
export function getSingleCata(id) {
  return request({
    url: `/subject/directory/${id}`,
    method: 'GET'
  })
}
// /subject/subject/+data.id
// 修改单个目录的信息
export function editSingleCata(data) {
  return request({
    url: `/subject/directory/${data.id}`,
    method: 'PUT',
    data
  })
}

